home *** CD-ROM | disk | FTP | other *** search
- Path: chronicle.mti.sgi.com!news
- From: austern@isolde.mti.sgi.com (Matt Austern)
- Newsgroups: comp.lang.c++
- Subject: Re: Theoretical C++ Question
- Date: 10 Jan 1996 20:01:20 GMT
- Organization: SGI
- Message-ID: <AUSTERN.96Jan10120120@isolde.mti.sgi.com>
- References: <4d152b$dd2$1@mhafc.production.compuserve.com>
- Reply-To: austern@mti.sgi.com
- NNTP-Posting-Host: isolde.mti.sgi.com
- In-reply-to: Pascal Pereira's message of 10 Jan 1996 19:46:19 GMT
-
- In article <4d152b$dd2$1@mhafc.production.compuserve.com> Pascal Pereira <71172.2025@CompuServe.COM> writes:
-
- > I have an old program written in C that uses function pointers.
- > Is there any way to mimic function pointer code in C++ or does
- > this require a fundamental change to the structure of the
- > old code.
-
- C++ has function pointers. It's quite possible that your code isn't a
- valid C++ program (it might, for example, use variable names that are
- reserved words in C++ but not in C), so it might be necessary to do
- some work to get it to compile as C++, but it should not be necessary
- to eliminate function pointers.
-
- C++ provides some alternatives that may be better (functor objects,
- virtual functions, and so on), but you don't have to change your
- design if you don't want to.
-
-
- Matt Austern
- SGI: MTI Compilers Group
- austern@isolde.mti.sgi.com
- --
- Matt Austern
- SGI: MTI Compilers Group
- austern@isolde.mti.sgi.com
-